package com.acme;

//TODO: define class body
public class SavingAccount extends AbstractAccount {

	public SavingAccount(double amount) {
		super(amount);
	}

	@Override
	public void withdraw(double amount) {
		if(amount >= 0) {
			if(this.balance >= amount) {
				this.balance -= amount;
			} else {
				this.balance = -1;
				System.out.println("You have no money to withdraw!");
			}
		} else {
			this.balance = -1;
			System.out.println("You can't withdraw negative amount!");
		}
	}

	@Override
	public double maximumAmountToWithdraw() {
		return this.balance;
	}

}
